import { prisma } from '@/lib/prisma'
import { NextResponse } from 'next/server'

export async function GET() {
  const recentSales = await prisma.sale.findMany({
    orderBy: {
      createdAt: 'desc',
    },
    take: 5, // 获取最近的 5 条销售记录
  })
  return NextResponse.json(recentSales)
}
